| 92 | }; |
| 93 | |
| 94 | static void* SendLargeFile(void* raw_args) { |
| 95 | std::unique_ptr<Args> args(static_cast<Args*>(raw_args)); |
| 96 | if (args->pa == NULL) { |
| 97 | LOG(ERROR) << "ProgressiveAttachment is NULL"; |
| 98 | return NULL; |
| 99 | } |
| 100 | for (int i = 0; i < 100; ++i) { |
| 101 | char buf[16]; |
| 102 | int len = snprintf(buf, sizeof(buf), "part_%d ", i); |
| 103 | args->pa->Write(buf, len); |
| 104 | |
| 105 | // sleep a while to send another part. |
| 106 | bthread_usleep(10000); |
| 107 | } |
| 108 | return NULL; |
| 109 | } |
| 110 | |
| 111 | void default_method(google::protobuf::RpcController* cntl_base, |
| 112 | const HttpRequest*, |
nothing calls this directly
no test coverage detected