All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 84fd81d4 authored by Robert Ricci's avatar Robert Ricci

Change output to stdout so that it plays well with monitor.py

Implement the write() wrapper, so that it works with wget
parent 5f44bf30
......@@ -174,7 +174,7 @@ void log_packet(int fd, size_t len) {
/*
fprintf(stderr,"%lu.%08lu [%i, %i]\n",time.tv_sec, time.tv_usec, fd,len);
*/
fprintf(stderr,"%lu.%06lu > %s.%i (%i)\n",time.tv_sec, time.tv_usec,
fprintf(stdout,"%lu.%06lu > %s.%i (%i)\n",time.tv_sec, time.tv_usec,
monitorFDs[fd].remote_hostname, monitorFDs[fd].remote_port, len);
}
......@@ -306,3 +306,23 @@ ssize_t send(int s, const void *msg, size_t len, int flags) {
return rv;
}
ssize_t write(int fd, const void *buf, size_t count) {
ssize_t rv;
lnm_init();
/*
* Wait until _after_ the packet is sent to log it, since the call might
* block, and we basically want to report when the kernel acked receipt of
* the packet
*/
rv = real_write(fd,buf,count);
if ((rv > 0) && monitorFD_p(fd)) {
log_packet(fd,rv);
}
return rv;
}
......@@ -27,7 +27,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
/* #define DEBUGGING */
/* #define DEBUGGING */
#ifdef DEBUGGING
#define DEBUG(x) (x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment