예제 #1
0
	void print(const x0::BufferRef& v, const char *msg = 0)
	{
		if (msg && *msg)
			printf("buffer.view(%s): '%s'\n", msg, v.str().c_str());
		else
			printf("buffer.view: '%s'\n", v.str().c_str());

		printf("  size=%ld\n", v.size());
	}
예제 #2
0
파일: io_test.cpp 프로젝트: tempbottle/x0
  void print(const x0::BufferRef& v, const char* msg = 0) {
    char prefix[64];
    if (msg && *msg)
      snprintf(prefix, sizeof(prefix), "\nbuffer.view(%s)", msg);
    else
      snprintf(prefix, sizeof(prefix), "\nbuffer.view");

    if (v)
      printf("\n%s: '%s' (size=%ld)\n", prefix, v.str().c_str(), v.size());
    else
      printf("\n%s: NULL\n", prefix);
  }
예제 #3
0
파일: webdav.cpp 프로젝트: TwinkleStars/x0
	void onContent(const x0::BufferRef& chunk)
	{
		if (chunk.empty()) {
			if (created_)
				request_->status = x0::HttpStatus::Created;
			else
				request_->status = x0::HttpStatus::NoContent;

			request_->finish();
			::close(fd_);

			delete this;
		} else {
			::write(fd_, chunk.data(), chunk.size());
			// check return code and possibly early abort request with error code indicating diagnostics
		}
	}
예제 #4
0
void FastCgiHealthMonitor::onStdOut(const x0::BufferRef& chunk)
{
	TRACE("onStdOut: chunk.size=%ld", chunk.size());
	process(chunk);
}