예제 #1
0
파일: sbd-md.c 프로젝트: credativ/sbd
int dump_headers(struct servants_list_item *servants)
{
	int rc = 0;
	struct servants_list_item *s = servants;
	struct sbd_context *st;

	for (s = servants; s; s = s->next) {
		fprintf(stdout, "==Dumping header on disk %s\n", s->devname);
		st = open_device(s->devname, LOG_WARNING);
		if (!st) {
			fprintf(stdout, "== disk %s unreadable!\n", s->devname);
			continue;
		}

		rc = header_dump(st);
		close_device(st);

		if (rc == -1) {
			fprintf(stdout, "==Header on disk %s NOT dumped\n", s->devname);
		} else {
			fprintf(stdout, "==Header on disk %s is dumped\n", s->devname);
		}
	}
	return rc;
}
예제 #2
0
void hlist_dump(const HList* hlist, FILE* fp) {
  if (!hlist) {
    return;
  }

  int j;
  for (j = 0; j < hlist->ulen; ++j) {
    HNode* n = &hlist->data[j];
    header_dump(n->header, fp);
    plist_dump(n->values, fp);
  }
  fflush(fp);
}
예제 #3
0
/**
 * Redefine callback invoked when we got the whole HTTP reply.
 *
 * @param ha		the HTTP async request descriptor
 * @param s			the socket on which we got the reply
 * @param status	the first HTTP status line
 * @param header	the parsed header structure
 */
static void
gwc_got_reply(const http_async_t *ha,
              const gnutella_socket_t *s, const char *status, const header_t *header)
{
    if (GNET_PROPERTY(bootstrap_debug) > 3)
        g_debug("GWC got reply from %s", http_async_url(ha));

    if (GNET_PROPERTY(bootstrap_debug) > 5) {
        g_debug("----Got GWC reply from %s:",
                host_addr_to_string(s->addr));
        if (log_printable(LOG_STDERR)) {
            fprintf(stderr, "%s\n", status);
            header_dump(stderr, header, "----");
        }
    }
}
예제 #4
0
파일: soap.c 프로젝트: Haxe/gtk-gnutella
/**
 * Redefine callback invoked when we got the whole HTTP reply.
 */
static void
soap_got_reply(const http_async_t *ha,
	const struct gnutella_socket *s, const char *status, const header_t *header)
{
	soap_rpc_t *sr = http_async_get_opaque(ha);

	soap_rpc_check(sr);
	
	if (GNET_PROPERTY(soap_trace) & SOCK_TRACE_IN) {
		g_debug("----Got SOAP HTTP reply from %s:",
			host_addr_to_string(s->addr));
		if (log_printable(LOG_STDERR)) {
			fprintf(stderr, "%s\n", status);
			header_dump(stderr, header, "----");
		}
	}
}