* Remove XepXfer->rx_len, which is always 0.
* Rewrite Bonjour SOCKS5 communication using Gio.
The `bonjour_sock5_request_cb` function is confusing, incrementing `xf->sock5_req_state`, and then calling itself again to get to the next part of the switch. Using individual callback functions is required by Gio, but also hopefully clearer.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/215/
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* Component written by Tomek Wasilczyk (http://www.wasilczyk.pl).
*
* This file is dual-licensed under the GPL2+ and the X11 (MIT) licences.
* As a recipient of this file you may choose, which license to receive the
* code under. As a contributor, you have to ensure the new code is
* compatible with both.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include"keymapper.h"
/* The problem: we want to convert 64-bit unique integers into unique gpointer
* keys (that may be 32-bit or 64-bit, or whatever else). We also want to
* convert it back.
*
* The idea: let's store every value in our internal memory. Then, its address
* can be also an unique key. We also need a map, to quickly figure out the
* address for any previously stored value.
*
* The naming problem: values becames the keys and vice-versa.
*/
/* TODO
* For a 64-bit gpointer, keymapper could just do nothing and return the value
* as a key. But it have to be figured out at a compile time.
*/
struct_ggp_keymapper
{
/* Table keys: pointers to 64-bit mapped *values*.
* Table values: keys (gpointers) corresponding to mapped values.
*
* Ultimately, both keys and values are the same pointers.