Changeset 4424 for trunk/packages/vizservers
- Timestamp:
- Jun 25, 2014, 1:32:56 AM (10 years ago)
- Location:
- trunk/packages/vizservers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/geovis/RenderServer.cpp
r4349 r4424 74 74 << " {" << ((view.getSRS() == NULL) ? "" : view.getSRS()->getVertInitString()) << "}" 75 75 << "\n"; 76 len = oss.str().size(); 77 #ifdef USE_THREADS 78 queueResponse(oss.str().c_str(), len, Response::VOLATILE); 76 std::string ostr = oss.str(); 77 len = ostr.size(); 78 #ifdef USE_THREADS 79 queueResponse(ostr.c_str(), len, Response::VOLATILE); 79 80 #else 80 ssize_t bytesWritten = SocketWrite(os s.str().c_str(), len);81 ssize_t bytesWritten = SocketWrite(ostr.c_str(), len); 81 82 82 83 if (bytesWritten < 0) { … … 169 170 { 170 171 std::ostringstream oss; 171 oss << "nv>ok -token " << g_stats.nCommands << "\n"; 172 int nBytes = oss.str().length(); 172 oss << "nv>ok -token " << g_stats.nCommands << "\n"; 173 std::string ostr = oss.str(); 174 int nBytes = ostr.length(); 173 175 174 176 TRACE("Sending OK for commands through %lu", g_stats.nCommands); 175 177 #ifdef USE_THREADS 176 queueResponse(os s.str().c_str(), nBytes, Response::VOLATILE, Response::OK);177 #else 178 if (write(g_fdOut, os s.str().c_str(), nBytes) < 0) {178 queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::OK); 179 #else 180 if (write(g_fdOut, ostr.c_str(), nBytes) < 0) { 179 181 ERROR("write failed: %s", strerror(errno)); 180 182 return -1; -
trunk/packages/vizservers/geovis/RendererCmd.cpp
r4422 r4424 176 176 << " {" << ((view.getSRS() == NULL) ? "" : view.getSRS()->getVertInitString()) << "}" 177 177 << "\n"; 178 len = oss.str().size(); 178 std::string ostr = oss.str(); 179 len = ostr.size(); 179 180 #ifdef USE_THREADS 180 queueResponse(os s.str().c_str(), len, Response::VOLATILE);181 queueResponse(ostr.c_str(), len, Response::VOLATILE); 181 182 #else 182 ssize_t bytesWritten = SocketWrite(os s.str().c_str(), len);183 ssize_t bytesWritten = SocketWrite(ostr.c_str(), len); 183 184 184 185 if (bytesWritten < 0) { … … 1187 1188 std::ostringstream path; 1188 1189 path << "/tmp/tmp" << getpid() << ".earth"; 1189 FILE *tmpFile = fopen(path.str().c_str(), "w"); 1190 const char *pathStr = path.str().c_str(); 1191 FILE *tmpFile = fopen(pathStr, "w"); 1190 1192 fwrite(buf, len, 1, tmpFile); 1191 1193 fclose(tmpFile); 1192 g_renderer->loadEarthFile(path .str().c_str());1193 unlink(path .str().c_str());1194 g_renderer->loadEarthFile(pathStr); 1195 unlink(pathStr); 1194 1196 free(buf); 1195 1197 } else { … … 1844 1846 std::ostringstream oss; 1845 1847 oss << "nv>viserror -type internal_error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string; 1846 nBytes = oss.str().length(); 1847 1848 if (queueResponse(oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) { 1848 std::string ostr = oss.str(); 1849 nBytes = ostr.length(); 1850 1851 if (queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) { 1849 1852 return -1; 1850 1853 } -
trunk/packages/vizservers/geovis/Stats.cpp
r4349 r4424 101 101 102 102 int fd = getStatsFile(); 103 int result = writeToStatsFile(fd, oss.str().c_str(),104 oss.str().length());103 std::string ostr = oss.str(); 104 int result = writeToStatsFile(fd, ostr.c_str(), ostr.length()); 105 105 close(fd); 106 106 return result; … … 121 121 keyStream << key << " " 122 122 << getpid(); 123 124 TRACE("Stats file key: '%s'", key Stream.str().c_str());123 std::string keystr = keyStream.str(); 124 TRACE("Stats file key: '%s'", keystr.c_str()); 125 125 126 126 md5_init(&state); 127 md5_append(&state, (const md5_byte_t *)key Stream.str().c_str(), keyStream.str().length());127 md5_append(&state, (const md5_byte_t *)keystr.c_str(), keystr.length()); 128 128 md5_finish(&state, digest); 129 129 for (int i = 0; i < 16; i++) { -
trunk/packages/vizservers/nanovis/Command.cpp
r4422 r4424 2302 2302 std::ostringstream oss; 2303 2303 oss << "nv>viserror -type internal_error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string; 2304 nBytes = oss.str().length(); 2304 std::string ostr = oss.str(); 2305 nBytes = ostr.length(); 2305 2306 2306 2307 #ifdef USE_THREADS 2307 queueResponse(os s.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR);2308 queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::ERROR); 2308 2309 #else 2309 2310 if (write(fdOut, oss.str().c_str(), nBytes) < 0) {
Note: See TracChangeset
for help on using the changeset viewer.