#define BUFSIZE 16

#ifndef __HTTPCLIENT_H__
#define __HTTPCLIENT_H__

#include <sstream>
#include <algorithm>// for remove function
#include <oasys/oasys-config.h>
#include <oasys/thread/Timer.h>
#include "dtnClient.h"
#include <stdio.h>
#include <curl/curl.h>
#include <assert.h>

struct MemoryStruct {
  char* memory;
  size_t size;
};

struct buf {
    char*  buffer;
    size_t bufferlen;
    size_t writepos;
};

using namespace std;

class dtnClient;// end dtnClient class 

class httpClient:public oasys::Thread{

	public: 
		httpClient(); 
		~httpClient(); 
		void run(); 
		
		void get_data(char* buffer, size_t length, string dest); // called by http proxy server to get data, different than the one in http proxy client
		void print_data(char* buffer, u_int length);

		static size_t write_data( char* ptr, size_t size, size_t nmemb, MemoryStruct* userdata);

		void set_dest(string name); // set remote id

	private: 
		dtnClient* mydtn_;
		string source_;		    		   
	    	string dest_;

		

};

#endif
