Skip to content

It’s Not Right – But It’s Not Hopeless

April 3, 2015

15-04-03 bmpfail

This is my first try at direct-serving a bitmap. Obviously not right but safari does see that it’s supposed to be an image. I’ll look at the code but it may be easier to wait til i’m home where i can trace the data flow. It may be something to do with having or not having the right number of cr/lf’s at some point in the response.

void sendbmp(){
	printf("sending the bmp\n");
	sendconst(bmphdr); 	// Now Send a header
	sendconst(starshipbmp64);//and the binary data!
}
char bmphdr[]="HTTP/1.0 200 OK\r\nContent-Type: image/bmp\r\n\r\n";
char starshipbmp64[]={
0x42,0x4D,0x3E,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x3E,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x7E,0x00,
0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFC,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x00,0x03,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x03,0xFF,
0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0x00,0x03,0xFF,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,
0x03,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3F,0xFF,
0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,
0x3F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3C,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x3F,
0xFF,0xC0,0x00,0x00,0x0C,0x00,0xFF,0x3F,0xCC,0x00,
0x00,0x00,0x00,0x00,0xFC,0x3F,0xFF,0xC0,0x00,0x00,
0x0C,0x00,0xFF,0x3F,0xCC,0x00,0x00,0x00,0x00,0x00,
0xFC,0x3F,0xFF,0xC0,0x00,0x00,0x0C,0x00,0xFF,0x3F,
0xCC,0x00,0x00,0x00,0x00,0x00,0xFC,0x3F,0xFF,0xC0,
0x00,0x00,0x0C,0x00,0xFF,0x3F,0xCC,0x00,0x00,0x00,
0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,
0xC0,0x30,0x0C,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,
0x00,0x00,0x00,0x00,0x0C,0x00,0xC0,0x30,0x0C,0x00,
0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,
0x0C,0x00,0xC0,0x30,0x0C,0x00,0x00,0x00,0x00,0x00,
0x3C,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0xC0,0x30,
0x0C,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0xFF,0xFF,
0xFF,0xC3,0xFC,0x00,0xFC,0x30,0x0F,0xC0,0x00,0x00,
0x00,0x00,0x0F,0x00,0xFF,0xFF,0xFF,0xC3,0xFC,0x00,
0xFC,0x30,0x0F,0xC0,0x00,0x00,0x00,0x00,0x0F,0x00,
0xFF,0xFF,0xFF,0xC3,0xFC,0x00,0xFC,0x30,0x0F,0xC0,
0x00,0x00,0x00,0x00,0x0F,0x00,0xFF,0xFF,0xFF,0xC3,
0xFC,0x00,0xFC,0x30,0x0F,0xC0,0x00,0x00,0x00,0x00,
0x00,0xFF,0x0C,0x00,0x00,0xC3,0x00,0x00,0xC0,0x30,
0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x0C,0x00,
0x00,0xC3,0x00,0x00,0xC0,0x30,0x0C,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0x0C,0x00,0x00,0xC3,0x00,0x00,
0xC0,0x30,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0x0C,0x00,0x00,0xC3,0x00,0x00,0xC0,0x30,0x0C,0x00,
0x00,0x00,0x03,0xFC,0x03,0x00,0x30,0x00,0x00,0xC3,
0x00,0x00,0xFF,0x30,0x0F,0xF0,0x00,0x00,0x03,0xFC,
0x03,0x00,0x30,0x00,0x00,0xC3,0x00,0x00,0xFF,0x30,
0x0F,0xF0,0x00,0x00,0x03,0xFC,0x03,0x00,0x30,0x00,
0x00,0xC3,0x00,0x00,0xFF,0x30,0x0F,0xF0,0x00,0x00,
0x03,0xFC,0x03,0x00,0x30,0x00,0x00,0xC3,0x00,0x00,
0xFF,0x30,0x0F,0xF0,0x00,0x00,0x3F,0xFF,0xCC,0x00,
0xC0,0x00,0x00,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0xFF,0xCC,0x00,0xC0,0x00,0x00,0xC3,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,
0xCC,0x00,0xC0,0x00,0x00,0xC3,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3F,0xFF,0xCC,0x00,0xC0,0x00,
0x00,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
0xC0,0x00,0x3F,0xFF,0xF0,0x00,0x00,0xC3,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,
0xF0,0x00,0x00,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0,0x00,0x00,0xC3,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,
0x3F,0xFF,0xF0,0x00,0x00,0xC3,0x00,0x00,0x00,0x00,
0x00,0x00,0xC0,0x00,0x03,0xFC,0x00,0x00,0x0C,0x00,
0x00,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,
0x03,0xFC,0x00,0x00,0x0C,0x00,0x00,0xC3,0x00,0x00,
0x00,0x00,0x00,0x00,0xC0,0x00,0x03,0xFC,0x00,0x00,
0x0C,0x00,0x00,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,
0xC0,0x00,0x03,0xFC,0x00,0x00,0x0C,0x00,0x00,0xC3,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,
0x3F,0xFF,0xF0,0x03,0xFF,0xC3,0xFF,0xFF,0xFF,0xFF,
0xFF,0xF0,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0,0x03,
0xFF,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xFF,0xFF,
0xC0,0x00,0x3F,0xFF,0xF0,0x03,0xFF,0xC3,0xFF,0xFF,
0xFF,0xFF,0xFF,0xF0,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,
0xF0,0x03,0xFF,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,
0x00,0x00,0xFF,0xFF,0xF0,0x00,0x00,0x0C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0xFF,0xFF,
0xF0,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x30,0x00,0x00,0xFF,0xFF,0xF0,0x00,0x00,0x0C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,
0xFF,0xFF,0xF0,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x30,0x00,0x00,0x00,0xF0,0x00,0x00,
0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,
0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x0C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0xF0,
0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0C,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x0C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xF0,0x00};
Advertisements

From → web server

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: