Gnutella Forums  

Go Back   Gnutella Forums > Discontinued Gnutella Client Forums > Mutella (Linux/Unix)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Mutella (Linux/Unix) Mutella has been discontinued. We highly recommend you use an actively developed client instead.


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old August 21st, 2002
Moak
Guest
 
Posts: n/a
Default

Good luck with your new home, if you're becoming my neighbour call me for a beer. :)

Thx for the answers, I still need lots of time. Since my network
class grows with my server (no Gnutella thingie) and the server
takes all my time. I'll plan to use STL std::string with some tiny
addition yet like sstring::format() and sstring::operator const char*().

Btw when using std::string here's a port of format() member:

Code:
void vformat(const char *fmt, va_list ap)
{
    if(strstr(fmt, "%n")) {             //check against %n, which can be exploited by accident
        assert(0 && "sstring::format: Parachute for unsafe type %n");
        assign(fmt);                    //note: really nobody needs unsafe %n
        return;
    }
    
    std::vector<char> buffer;           //buffer for creating string
    size_t size = strlen(fmt)+16;       //some extra characters, string will grow

    while (1) 
    {
        buffer.reserve(size);           //ensure we have that much space in the buffer
                                        //try to print into allocated space
        int n = vsnprintf(&buffer[0], buffer.capacity(), fmt, ap);
        if (n>-1 && n<buffer.capacity())
        {                               //allocated space was fine
            assign(&buffer[0]);         //store the formated string (unfortunately a copy)
            return;
        }
                                        //else try again with more space
        if (n>-1)                       //glibc 2.1
            size = n+1;                 //precisely what is needed
        else                            //glibc 2.0 or MS-crt
            size = buffer.capacity()*2; //twice the old size
    }
}
Reply With Quote
  #12 (permalink)  
Old September 4th, 2002
Unregistered
Guest
 
Posts: n/a
Default

hm, I wonder where the random generator is initialized? grep srand finds nothing. Propably I'm using an old version?
Reply With Quote
  #13 (permalink)  
Old September 19th, 2002
Mutella Developer
 
Join Date: January 30th, 2002
Location: Germany
Posts: 87
maksik is flying high
Default

Quote:
Originally posted by Moak
Good luck with your new home, if you're becoming my neighbour call me for a beer.
Goood idea Moak! Once I get things right here I'd be looking for an occasion :-))

--Max
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
any updates to mutella? Gateway Mutella (Linux/Unix) 3 December 2nd, 2005 06:13 PM
Mutella 0.4 is out! maksik Mutella (Linux/Unix) 5 November 20th, 2003 11:34 AM
mutella newbie question hotcarl Mutella (Linux/Unix) 2 September 8th, 2002 06:02 AM
Welcome to the Mutella forum maksik Mutella (Linux/Unix) 3 March 7th, 2002 08:36 AM
Why not a Mutella forum fefu Mutella (Linux/Unix) 7 March 7th, 2002 08:19 AM


All times are GMT -7. The time now is 11:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.