Skip to content

Instantly share code, notes, and snippets.

View andrueastman's full-sized avatar

Eastman andrueastman

View GitHub Profile
@andrueastman
andrueastman / gist:b2d47d76db68f353ca74bc4271b0a089
Created February 28, 2019 11:00 — forked from aliostad/gist:3202814
Serialisation and deserialisation of HTTP request and response messages in ASP.NET Web API
public interface IHttpMessageSerializer
{
void Serialize(HttpResponseMessage response, Stream stream);
void Serialize(HttpRequestMessage request, Stream stream);
HttpResponseMessage DeserializeToResponse(Stream stream);
HttpRequestMessage DeserializeToRequest(Stream stream);
}
public class MessageContentHttpMessageSerializer : IHttpMessageSerializer
@andrueastman
andrueastman / scratchpad.c
Created December 7, 2016 12:09
Interesting bug. :(
leng = (scratchpad[1]*2);
for (j=0,i=0;i<leng,j<scratchpad[1];j++,i+=2)
{
scratchpad[2+j] = ascii2hex( buffer[DATA+7+i], buffer[DATA+8+i]);
temp_length = sprintf( (char*)&scratchpad[0], (const rom far void *)"PROCESSED_3:%02x:%02x",scratchpad[2+j]);
testif_write( scratchpad,temp_length );
}