diff options
| author | Michael Brown | 2007-01-15 09:49:10 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-15 09:49:10 +0100 |
| commit | 4e20d73bb52326261f8cf49c20d6de2edea309ee (patch) | |
| tree | 3d24466a78c4c8f53294384b76e62e871eb96def /src/tests/hellotest.c | |
| parent | Add missing include (diff) | |
| download | ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.gz ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.xz ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.zip | |
Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS. (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).
Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
Diffstat (limited to 'src/tests/hellotest.c')
| -rw-r--r-- | src/tests/hellotest.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/tests/hellotest.c b/src/tests/hellotest.c deleted file mode 100644 index a873c03e2..000000000 --- a/src/tests/hellotest.c +++ /dev/null @@ -1,43 +0,0 @@ -#include <stdint.h> -#include <string.h> -#include <byteswap.h> -#include <console.h> -#include <vsprintf.h> -#include <gpxe/async.h> -#include <gpxe/hello.h> - -static void test_hello_callback ( char *data, size_t len ) { - unsigned int i; - char c; - - for ( i = 0 ; i < len ; i++ ) { - c = data[i]; - if ( c == '\r' ) { - /* Print nothing */ - } else if ( ( c == '\n' ) || ( c >= 32 ) || ( c <= 126 ) ) { - putchar ( c ); - } else { - putchar ( '.' ); - } - } -} - -void test_hello ( struct sockaddr_tcpip *server, const char *message ) { - /* Quick and dirty hack */ - struct sockaddr_in *sin = ( struct sockaddr_in * ) server; - struct hello_request hello; - int rc; - - printf ( "Saying \"%s\" to %s:%d\n", message, - inet_ntoa ( sin->sin_addr ), ntohs ( sin->sin_port ) ); - - memset ( &hello, 0, sizeof ( hello ) ); - memcpy ( &hello.server, server, sizeof ( hello.server ) ); - hello.message = message; - hello.callback = test_hello_callback; - - rc = async_wait ( say_hello ( &hello ) ); - if ( rc ) { - printf ( "HELLO fetch failed\n" ); - } -} |
