/***************************************************************************
                          http.h  -  description
                             -------------------
    begin                : Mon Dec 8 2003
    copyright            : (C) 2003 by Wei Zheng
    email                : v_zheng@yahoo.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef HTTP_H
#define HTTP_H

#include <net.h>
#include <semaphore.h>
#include "response.h"
#include "onlineusers.h"

#define MESGSIZE 1536
#define NOTIFICATIONHTTPPROXY "gateway.messenger.hotmail.com"

extern onlineusers usersqueue;

/**
  *@author Wei Zheng
  */

class http : public net  {
public: 
	http();
	~http();

public:
  /** No descriptions */
  int send_mesg();
  /** No descriptions */
  int reci_mesg();
  /** No descriptions */
  int send_comm(int flag, char * comm, char * argu,...);
  /** No descriptions */
  int reci_mesg_head();
  /** No descriptions */
  int reci_mesg_body(int length);
  void makeurl();
  int get_resp();
  int get_mesg(int len);

public:
  post_request_parameters prp;
  char sendmesgbuf[MESGSIZE];
  int sendmesglen;
  int sendmesgrea;
  char recimesgbuf[MESGSIZE];
  int recimesglen;
  char tmpline[256];
  char finline[256];
  char proxyaddr[32];
  int pipefd[2];
  int proxyport;
  response tmpresp;
  int counter;
  char * linep;
  sem_t bin_sem_finline_isfull;
  userinfo * userinfop;
};

#endif
