예제 #1
0
파일: httpcli.c 프로젝트: AlexTalks/bazel
static void done_write(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
  internal_request *req = arg;
  if (success) {
    on_written(exec_ctx, req);
  } else {
    next_address(exec_ctx, req);
  }
}
예제 #2
0
파일: httpcli.c 프로젝트: sihai/grpc
static void done_write(void *arg, grpc_endpoint_cb_status status) {
  internal_request *req = arg;
  switch (status) {
    case GRPC_ENDPOINT_CB_OK:
      on_written(req);
      break;
    case GRPC_ENDPOINT_CB_EOF:
    case GRPC_ENDPOINT_CB_SHUTDOWN:
    case GRPC_ENDPOINT_CB_ERROR:
      next_address(req);
      break;
  }
}
예제 #3
0
파일: httpcli.c 프로젝트: sihai/grpc
static void start_write(internal_request *req) {
  gpr_slice_ref(req->request_text);
  switch (
      grpc_endpoint_write(req->ep, &req->request_text, 1, done_write, req)) {
    case GRPC_ENDPOINT_WRITE_DONE:
      on_written(req);
      break;
    case GRPC_ENDPOINT_WRITE_PENDING:
      break;
    case GRPC_ENDPOINT_WRITE_ERROR:
      finish(req, 0);
      break;
  }
}