Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2016-07-24 gettextize <[email protected]>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't commit these changes to the Changelog and configure.ac.


* configure.ac (AC_CONFIG_FILES): Add intl/Makefile, po/Makefile.in.

2008-11-30 Brian Masney <[email protected]>
* docs/website/index.html.in docs/website/generate-gftp-website.pl
docs/website/announce.txt ChangeLog-old - updated for the 2.0.19
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ AM_GNU_GETTEXT
AC_CHECK_PROG(DB2HTML, db2html, true, false)
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)

<<<<<<< HEAD:configure.ac
AC_CONFIG_FILES(po/Makefile.in
intl/Makefile
=======
AC_CONFIG_FILES(
>>>>>>> 06f54cef98bf54bc4917566fe6b3c403e8330402:configure.ac
Makefile
docs/Makefile
docs/sample.gftp/Makefile
Expand Down
36 changes: 0 additions & 36 deletions lib/charset-conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#include "gftp.h"

#if GLIB_MAJOR_VERSION > 1

static /*@null@*/ char *
_gftp_get_next_charset (char **curpos)
{
Expand Down Expand Up @@ -226,37 +224,3 @@ gftp_filename_from_utf8 (gftp_request * request, const char *str,
return (_do_convert_string (request, 1, 0, str, dest_len, 1));
}

#else

char *
gftp_string_to_utf8 (gftp_request * request, const char *str, size_t dest_len)
{
return (NULL);
}


char *
gftp_string_from_utf8 (gftp_request * request, int force_local, const char *str,
size_t dest_len)
{
return (NULL);
}


char *
gftp_filename_to_utf8 (gftp_request * request, const char *str, size_t dest_len)
{
return (NULL);
}


char *
gftp_filename_from_utf8 (gftp_request * request, int force_local,
const char *str, size_t dest_len)
{
return (NULL);
}

#endif


40 changes: 38 additions & 2 deletions lib/gftp.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,45 @@ struct gftp_request_tag
SSL * ssl;
#endif

#if GLIB_MAJOR_VERSION > 1
GIConv iconv_to, iconv_from;
unsigned int iconv_from_initialized : 1,
iconv_to_initialized : 1;
char *iconv_charset;
#endif
};

/* Support deprecated functions for older glibs */
#if GLIB_CHECK_VERSION(2,31,0)
#undef g_static_mutex_lock
#define g_static_mutex_lock g_mutex_lock
#undef g_static_mutex_unlock
#define g_static_mutex_unlock g_mutex_unlock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just convert everything over to use the GMutex instead of the GStaticMutex. I don't think it is a good idea to redefine symbols in the glib library. Someone else looking through the code would expect one type of behavior, but doing things like this could cause it to have a different type of behavior, which will increase the over long-term maintenance of the project. Moving to GMutex should also get rid of all of the #ifdefs around the mutex code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I will make the required changes.


/* If I understand it correctly, we wouldn't normally get away with this
* but since we are already iniitializing it by calling malloc on the pointer
* I thnk we get a pass on having to change:
* GStaticMutex pointer to an (addressed) GMutex variable
*
* I suspect this will cause problems for someone down the road
*/
#define g_static_mutex_init g_mutex_init

/* Thanks to libvert for writing these two wrappers */
static inline GMutex *gftp_g_mutex_new(void)
{
GMutex *mutex;

mutex = g_new(GMutex, 1);
g_mutex_init(mutex);

return mutex;
}

static inline void gftp_g_mutex_free(GMutex *mutex)
{
g_mutex_clear(mutex);
g_free(mutex);
}
#endif

typedef struct gftp_transfer_tag
{
Expand Down Expand Up @@ -545,8 +576,13 @@ typedef struct gftp_transfer_tag
void * fromwdata,
* towdata;

#if GLIB_CHECK_VERSION(2,31,0)
GMutex statmutex,
structmutex;
#else
GStaticMutex statmutex,
structmutex;
#endif

void *user_data;
void *thread_id;
Expand Down
10 changes: 0 additions & 10 deletions lib/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,20 +543,12 @@ compare_request (gftp_request * request1, gftp_request * request2,
gftp_transfer *
gftp_tdata_new (void)
{
#if GLIB_MAJOR_VERSION == 1
static GStaticMutex init_mutex = G_STATIC_MUTEX_INIT;
#endif
gftp_transfer * tdata;

tdata = g_malloc0 (sizeof (*tdata));

#if GLIB_MAJOR_VERSION == 1
tdata->statmutex = init_mutex;
tdata->structmutex = init_mutex;
#else
g_static_mutex_init (&tdata->statmutex);
g_static_mutex_init (&tdata->structmutex);
#endif

return (tdata);
}
Expand Down Expand Up @@ -1171,9 +1163,7 @@ gftp_locale_init (void)
textdomain ("gftp");
bindtextdomain ("gftp", LOCALE_DIR);

#if GLIB_MAJOR_VERSION > 1
bind_textdomain_codeset ("gftp", "UTF-8");
#endif

#endif /* HAVE_GETTEXT */
}
Expand Down
2 changes: 0 additions & 2 deletions lib/protocols.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ gftp_disconnect (gftp_request * request)
}
#endif

#if GLIB_MAJOR_VERSION > 1
if (request->iconv_from_initialized)
{
g_iconv_close (request->iconv_from);
Expand All @@ -167,7 +166,6 @@ gftp_disconnect (gftp_request * request)
g_free (request->iconv_charset);
request->iconv_charset = NULL;
}
#endif

request->cached = 0;
if (request->disconnect == NULL)
Expand Down
4 changes: 4 additions & 0 deletions lib/sockutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ struct servent *
r_getservbyname (const char *name, const char *proto,
struct servent *result_buf, int *h_errnop)
{
#if GLIB_CHECK_VERSION(2,31,0)
static GMutex servfunclock;
#else
static GStaticMutex servfunclock = G_STATIC_MUTEX_INIT;
#endif
struct servent *sent;

if (g_thread_supported ())
Expand Down
25 changes: 16 additions & 9 deletions lib/sslcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,7 @@ _gftp_ssl_locking_function (int mode, int n, const char * file, int line)
static unsigned long
_gftp_ssl_id_function (void)
{
#if GLIB_MAJOR_VERSION > 1
return ((unsigned long) g_thread_self ());
#else
/* FIXME - call pthread version. */
return (0);
#endif
}


Expand All @@ -233,7 +228,11 @@ _gftp_ssl_create_dyn_mutex (const char *file, int line)
struct CRYPTO_dynlock_value *value;

value = g_malloc0 (sizeof (*value));
#if GLIB_CHECK_VERSION(2,31,0)
g_mutex_init (value->mutex);
#else
value->mutex = g_mutex_new ();
#endif
return (value);
}

Expand All @@ -253,7 +252,9 @@ static void
_gftp_ssl_destroy_dyn_mutex (struct CRYPTO_dynlock_value *l,
const char *file, int line)
{
g_mutex_free (l->mutex);
#if GLIB_CHECK_VERSION (2,31,0)
gftp_g_mutex_free (l->mutex);
#endif
g_free (l);
}

Expand All @@ -271,7 +272,12 @@ _gftp_ssl_thread_setup (void)
gftp_ssl_mutexes = g_malloc0 (CRYPTO_num_locks( ) * sizeof (*gftp_ssl_mutexes));

for (i = 0; i < CRYPTO_num_locks ( ); i++)
gftp_ssl_mutexes[i] = g_mutex_new ();

#if GLIB_CHECK_VERSION(2,31,0)
g_mutex_init (gftp_ssl_mutexes[i]);
#else
gftp_ssl_mutexes[i] = g_mutex_new ();
#endif

CRYPTO_set_id_callback (_gftp_ssl_id_function);
CRYPTO_set_locking_callback (_gftp_ssl_locking_function);
Expand Down Expand Up @@ -411,8 +417,9 @@ gftp_ssl_session_setup (gftp_request * request)
ssize_t
gftp_ssl_read (gftp_request * request, void *ptr, size_t size, int fd)
{
int *err;
err = 0;
ssize_t ret;
int err;

g_return_val_if_fail (request->ssl != NULL, GFTP_EFATAL);

Expand All @@ -429,7 +436,7 @@ gftp_ssl_read (gftp_request * request, void *ptr, size_t size, int fd)
{
if ((ret = SSL_read (request->ssl, ptr, size)) < 0)
{
err = SSL_get_error (request->ssl, ret);
*err = SSL_get_error (request->ssl, ret);
if (errno == EINTR || errno == EAGAIN)
{
if (request->cancel)
Expand Down
11 changes: 11 additions & 0 deletions po/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2016-07-24 gettextize <[email protected]>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these changes to the po/ directory should be committed. Your commits change about 60K lines and at a cursor glance, most appear to be in the po/ directory. Let the language translators make the changes to this directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I meant to exclude these, it shouldn't have gotten included.


* Makefile.in.in: New file, from gettext-0.19.4.
* Rules-quot: New file, from gettext-0.19.4.
* boldquot.sed: New file, from gettext-0.19.4.
* [email protected]: New file, from gettext-0.19.4.
* [email protected]: New file, from gettext-0.19.4.
* insert-header.sin: New file, from gettext-0.19.4.
* quot.sed: New file, from gettext-0.19.4.
* remove-potcdate.sin: New file, from gettext-0.19.4.

2009-05-20 Wadim Dziedzic <[email protected]>

* pl.po: Updated Polish translation
Expand Down
Loading