Commit Graph

3340 Commits

Author SHA1 Message Date
Mike Blumenkrantz ccc42ef509 error check server creation
SVN revision: 52612
2010-09-22 23:58:31 +00:00
Mike Blumenkrantz a1009c7893 cosmetic fix to use mixed protocol
SVN revision: 52610
2010-09-22 22:44:54 +00:00
Mike Blumenkrantz 0666d57062 better openssl error handlers
SVN revision: 52607
2010-09-22 22:33:02 +00:00
Mike Blumenkrantz 74d035df0b prefer stronger anonymous client encryption
also some progress on openssl that does nothing except make servers take forever to start


SVN revision: 52606
2010-09-22 22:06:49 +00:00
Mike Blumenkrantz 3150202755 clean up openssl handshake
SVN revision: 52597
2010-09-22 17:37:25 +00:00
Mike Blumenkrantz a37f3ab98e update to use automatic disconnect and quit after a connection
SVN revision: 52596
2010-09-22 17:22:11 +00:00
Cedric BAIL b462783cae * ecore: oops, forgot that change.
SVN revision: 52580
2010-09-22 11:09:44 +00:00
Cedric BAIL 8036a32918 * ecore: rename ecore_long_run to ecore_thread_feedback_run.
SVN revision: 52573
2010-09-22 09:47:55 +00:00
Vincent Torri 3fd0a6fb08 remove whitespaces
SVN revision: 52569
2010-09-22 08:03:38 +00:00
Mike Blumenkrantz 172da9d9cf finally. fix. ssl.
SVN revision: 52567
2010-09-22 07:27:07 +00:00
Mike Blumenkrantz 787b09464b disable PSK ciphers for now since they aren't implemented
SVN revision: 52565
2010-09-22 06:13:29 +00:00
Mike Blumenkrantz fb977d72c4 implement functions to time out client connections to our server
*set/get default idle timeout of clients*
+ecore_con_server_timeout_set
+ecore_con_server_timeout_get
*set/get idle timeout of a client*
+ecore_con_client_timeout_set
+ecore_con_client_timeout_get

*get connection uptime of a client/server*
+ecore_con_client_uptime_get
+ecore_con_server_uptime_get

*fix giant ssl server memory leak*


SVN revision: 52564
2010-09-22 04:48:09 +00:00
Mike Blumenkrantz 5420324fd6 add ECORE_CON_USE_MIXED, which is just an alias for SSL3+TLS
SVN revision: 52561
2010-09-22 01:26:23 +00:00
Mike Blumenkrantz 38188213cf !@#$ it, just going to rewrite the whole damn thing:
*fix gnutls client/server implementations to use correct ciphers and free memory properly
*prevent lots of segvs

this message brought to you by gnu dicks


SVN revision: 52559
2010-09-22 00:10:10 +00:00
Vincent Torri 565962c176 now that log colors work on Windows, let eina_log choose
the default colors

SVN revision: 52545
2010-09-21 16:38:33 +00:00
Mike Blumenkrantz c2da918bd5 fix ecore con openssl clients (really ecore_con_server...) sigh
SVN revision: 52538
2010-09-21 07:04:10 +00:00
Mike Blumenkrantz 5f34f2cb76 doxy fixes
c/o vtorri


SVN revision: 52535
2010-09-21 06:49:22 +00:00
Mike Blumenkrantz ad3ecd489a ecore_con_url_destroy -> ecore_con_url_free
also some small function rearranging


SVN revision: 52534
2010-09-21 06:49:07 +00:00
Mike Blumenkrantz 6121edec86 this should have gone in with r52531...
SVN revision: 52533
2010-09-21 05:34:49 +00:00
Mike Blumenkrantz 3b55af0102 fix doxy and EAPI for ssl function
SVN revision: 52532
2010-09-21 05:34:10 +00:00
Mike Blumenkrantz 0929a7a9ce -EAPI int ecore_con_url_url_set(Ecore_Con_Url *url_con,
+EAPI Eina_Bool         ecore_con_url_url_set(Ecore_Con_Url *url_con,
-EAPI int               ecore_con_url_httpauth_set(Ecore_Con_Url *url_con,
+EAPI Eina_Bool         ecore_con_url_httpauth_set(Ecore_Con_Url *url_con,
-EAPI int               ecore_con_url_send(Ecore_Con_Url *url_con,
+EAPI Eina_Bool         ecore_con_url_send(Ecore_Con_Url *url_con,
-EAPI int               ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
+EAPI Eina_Bool         ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,


SVN revision: 52531
2010-09-21 03:14:46 +00:00
Mike Blumenkrantz f6a8d74b50 formatting
SVN revision: 52530
2010-09-21 03:08:35 +00:00
Mike Blumenkrantz f3a2858f37 remove unused variable
SVN revision: 52529
2010-09-21 02:16:40 +00:00
Mike Blumenkrantz 786e2bd7e4 ecore_main_fd_handler_active_get -> Eina_Bool
SVN revision: 52528
2010-09-21 02:06:41 +00:00
Mike Blumenkrantz 89e6e0d30d ecore_ipc_server_connected_get -> Eina_Bool
SVN revision: 52526
2010-09-21 01:58:54 +00:00
Mike Blumenkrantz fdadea7eca ecore_con_server_connected_get now returns Eina_Bool
SVN revision: 52525
2010-09-21 01:48:46 +00:00
Mike Blumenkrantz 9d40676672 distribute examples
SVN revision: 52518
2010-09-20 21:17:39 +00:00
Mike Blumenkrantz 101089c62e ecore_con client example
SVN revision: 52517
2010-09-20 21:16:51 +00:00
Mike Blumenkrantz 45e75f937e ecore_con server example
SVN revision: 52516
2010-09-20 21:13:29 +00:00
Mike Blumenkrantz abed74df3a update doxyfile to warn more for missing params, prevent __UNUSED__ warnings, exclude all ecore_config
SVN revision: 52515
2010-09-20 21:13:05 +00:00
Mike Blumenkrantz 8c26eabb75 remove ecore_config stuff; also accidentally committed undocumented changes in r52512 as follows:
*update Doxyfile to new version
*fix doxygen warnings from samsung <tbd> email
*remove references to code that was probably last used by the roman empire


SVN revision: 52514
2010-09-20 21:12:08 +00:00
Mike Blumenkrantz e56789f77e This is the Doxygen Police! If you committed any of these lines, accept your public shaming!
SVN revision: 52513
2010-09-20 20:52:15 +00:00
Mike Blumenkrantz 130f5bec81 doxy error fixes
SVN revision: 52512
2010-09-20 20:33:50 +00:00
Mike Blumenkrantz 720fe88aef T_UNIX I AM GUESSING THIS WAS YOU!
@Brief != @brief!!!


SVN revision: 52510
2010-09-20 20:18:26 +00:00
Mike Blumenkrantz 40396f6867 doxy todo--
SVN revision: 52509
2010-09-20 20:12:17 +00:00
Mike Blumenkrantz 3ceb05fe0d authors updates
SVN revision: 52507
2010-09-20 20:04:05 +00:00
Mike Blumenkrantz c578a955ae fix obscure error case where CLIENT_DEL event is not generated after a client ssl pings ecore's server and disconnects immediately after handshake
SVN revision: 52504
2010-09-20 19:32:37 +00:00
Mike Blumenkrantz 137da6826d add cl->client_count member to prevent segv when counting a list that is actually null but hasn't been nulled
SVN revision: 52503
2010-09-20 19:31:11 +00:00
Mike Blumenkrantz d28a6dd5d6 formatting, switch lost_client to bool
SVN revision: 52501
2010-09-20 18:52:52 +00:00
Mike Blumenkrantz 8e3be2fef8 FINALLY FIX OPENSSL SERVER!!!!!!!!! YESSSSSSSSSSSSSSSSSSSSS
SVN revision: 52497
2010-09-20 18:25:21 +00:00
Lucas De Marchi 71cba7da35 Fix typos
"he->the" where appropriate



SVN revision: 52493
2010-09-20 17:09:13 +00:00
Mike Blumenkrantz 2733968495 fix unused warns
SVN revision: 52470
2010-09-19 19:41:06 +00:00
Mike Blumenkrantz 27e3324ad2 remove ssl2 support completely
SVN revision: 52469
2010-09-19 19:38:38 +00:00
Mike Blumenkrantz d1db6f1cf4 gnutls cleanup: only create diffie hellman bits on server init instead of for each client
overhead/blocking--
speed++


SVN revision: 52468
2010-09-19 19:25:47 +00:00
Mike Blumenkrantz 0c4707dcbc finally crush the last openssl segv
still broken though


SVN revision: 52467
2010-09-19 18:40:43 +00:00
Carsten Haitzler 624628e9d1 more warngins--
SVN revision: 52460
2010-09-19 03:55:06 +00:00
Carsten Haitzler bcf7b03bae warnings--
SVN revision: 52459
2010-09-19 03:51:56 +00:00
Carsten Haitzler 9a977e2262 warning--
SVN revision: 52458
2010-09-19 03:44:42 +00:00
Carsten Haitzler c1ea3349ac warning--
SVN revision: 52457
2010-09-19 03:29:30 +00:00
Carsten Haitzler 0abc6703ba warning--
SVN revision: 52456
2010-09-19 03:28:18 +00:00
Carsten Haitzler 2939d1548e fmting.
SVN revision: 52455
2010-09-19 03:26:59 +00:00
Carsten Haitzler 308f4b0c22 warnings--
SVN revision: 52454
2010-09-19 03:25:15 +00:00
Carsten Haitzler 773c57ea1a warning--
SVN revision: 52453
2010-09-19 03:09:09 +00:00
Mike Blumenkrantz 5775219503 check return of ssl_server_prepare
SVN revision: 52423
2010-09-18 19:29:43 +00:00
Mike Blumenkrantz 4239d5d67f giant cleanups/rewrites which are unnoticeable to users:
*client->server renamed client->host_server to clarify ambiguity
*ecore_con_ssl_client_prepare.* killed off because it was useless and wrong
*openssl generates only one SSL_CTX per server now instead of a new one for each client, which is broken/unnecessary/wasteful
**as a result, certificate loading is now only done once
**additionally this will save a very large amount of memory and avoid unnecessary/broken refcounting
*ecore_con_ssl_server_prepare.* rewritten to actually be useful instead of just a lazy way to null pointers
**all SSL_CTX code now goes here^
*some formatting fixes
*internal function renames


SVN revision: 52422
2010-09-18 19:26:05 +00:00
Vincent Torri f4f1dcf519 add the possibility to have shaped windows in ecore_evas (gdi
only for now)


SVN revision: 52418
2010-09-18 17:24:31 +00:00
Carsten Haitzler fa5b80b879 dont use tls max if it doesnt exist eh?
SVN revision: 52413
2010-09-18 11:41:15 +00:00
Mike Blumenkrantz 36bd287841 add mixed protocol for gnutls as well
SVN revision: 52412
2010-09-18 08:46:17 +00:00
Mike Blumenkrantz a8ef623de7 allow mixing sslv3+tlsv1 in openssl, FINALLY FIX INITIAL BUG FOR OPENSSL SERVERS!
note that openssl servers still do not work because there is more than one bug :/


SVN revision: 52411
2010-09-18 08:36:13 +00:00
Mike Blumenkrantz f62bcf1ff1 switch private struct members from char bitfields to Eina_Bool bitfields
no noticeable difference


SVN revision: 52399
2010-09-18 06:30:13 +00:00
Mike Blumenkrantz f8d56a023f a loooooooot of outdents and reformatting
SVN revision: 52397
2010-09-18 06:06:05 +00:00
Mike Blumenkrantz e9361b4e1c whoops forgot an UNUSED for openssl
SVN revision: 52396
2010-09-18 05:32:27 +00:00
Mike Blumenkrantz ac86c1aaa4 more progress on fixing openssl servers, fix all warnings, add error checking for openssl code
SVN revision: 52395
2010-09-18 05:31:00 +00:00
Mike Blumenkrantz 3736856f82 stop the indenting and line wrapping madness!!!!!!!
SVN revision: 52394
2010-09-18 05:30:16 +00:00
Mike Blumenkrantz 8cd87afb04 outdent for readability
SVN revision: 52393
2010-09-18 04:59:11 +00:00
Mike Blumenkrantz d8afcde705 add rest of ssl algorithms and clean up
SVN revision: 52391
2010-09-18 01:27:38 +00:00
Mike Blumenkrantz 8db37b8518 formatting
SVN revision: 52390
2010-09-18 01:20:25 +00:00
Mike Blumenkrantz 5e499b0c0e fix gnutls ssl
SVN revision: 52385
2010-09-17 19:43:03 +00:00
Mike Blumenkrantz 6542578149 new ssl error output: now with detailed location info and 50% more fiber!
SVN revision: 52380
2010-09-17 17:39:32 +00:00
Mike Blumenkrantz d74f46d5a5 simplify error conditions and output errrors on failure
SVN revision: 52378
2010-09-17 17:22:59 +00:00
Mike Blumenkrantz c7608248dd enable compression for gnutls, add error checks to client functions
SVN revision: 52377
2010-09-17 17:18:41 +00:00
Mike Blumenkrantz cb0c97b6c3 add error checking for servers
SVN revision: 52376
2010-09-17 17:03:15 +00:00
Mike Blumenkrantz 3e98b064d3 use right pointer for ssl ctx to avoid segv
SVN revision: 52362
2010-09-17 08:58:23 +00:00
Mike Blumenkrantz f3a9a92d36 fix ssl to work with cert loading flag
SVN revision: 52361
2010-09-17 08:00:42 +00:00
Vincent Torri 5973521793 check returned value of evas_engine_info_set()
SVN revision: 52360
2010-09-17 06:14:08 +00:00
Vincent Torri 56fa2461ed warning--
SVN revision: 52292
2010-09-15 08:41:41 +00:00
Bruno Dilly d0eb6e4054 Add missing bogosity X cursor
SVN revision: 52270
2010-09-14 21:43:44 +00:00
Vincent Torri 93f58106a6 ecore_win32 does not depend on Evas.
SVN revision: 52264
2010-09-14 21:25:31 +00:00
Vincent Torri 47b00392a7 useless define (already defined in command line)
SVN revision: 52247
2010-09-14 16:47:01 +00:00
Carsten Haitzler f200c483b4 epoll - bad. disable default support. u have to --enable it. don't
--enable it if u want elm quicklaunch to work.



SVN revision: 52240
2010-09-14 10:38:28 +00:00
Carsten Haitzler 4081d86c6c better cleanup of poll fd's on shutdown
SVN revision: 52229
2010-09-14 00:53:57 +00:00
Carsten Haitzler 4f823dab67 fix first map bug handling to handle more than first window map.
SVN revision: 52200
2010-09-13 22:16:26 +00:00
Brett Nash ee8881634b Add a semicolon. GCC: This ones for you.
SVN revision: 52184
2010-09-13 09:16:01 +00:00
Brett Nash 5ea066ec74 Deniggle and rename the exore_x_dndn_callback_pos_update_set call.
SVN revision: 52183
2010-09-13 09:15:57 +00:00
Brett Nash ba4ae189ea Use -1.
SVN revision: 52182
2010-09-13 09:15:53 +00:00
Brett Nash e36847a0ab Xdnd callback (API Addition): Rationale below.
Essentially the problem is this: For drag and drop Ecore currently handles the
position update calls.  But usually the application wants to display some user
feedback - a window to display the drag selection for instance.

Now the way e17 does it is grab the mouse cursor movements and track them
itself.  However ecore is already doing this, it's already walking window
trees, calculating real positions, _and_ sending them in an X client message.
So it seems rather silly to duplicate the code in the user app to get the same
info.

We could possibly have added a new event, but then we need to deal the fact
the position update may arrive _After_ the item has been dropped.  Hilarity
ensures[1].

This callback is meant for purely the selection owner of the drag to use, so
it is a callback set, not an add.

[1] Segfaults probably.  Nothing funnier.

SVN revision: 52181
2010-09-13 09:15:50 +00:00
Brett Nash 310ee61355 Always return an x rander version (unset in this case).
SVN revision: 52180
2010-09-13 09:15:45 +00:00
Carsten Haitzler fae947f8ea do extra composite checks - need to do the lot to be useful.
SVN revision: 52121
2010-09-10 06:57:21 +00:00
Lucas De Marchi 325e08065d Fix priority dropping
Lowering priority was wrong. Some bugs:

1) You don't lower the priority by setting the scheduler policy to some
   of the real-time ones (SCHED_RR or SCHER_FIFO). If you do so, you are
   actually increasing the priority of the workers and your main thread
   you be preempted and stalled until the workers complete their job.
   Fortunately this will only happen if your programming is running as
   root, as normal users (without CAP_SYS_NICE) are unable to set
   priority to real-time values.

2) setpriority() and getpriority() are not part of pthread and you can't
   use the id returned by pthread. Manpage explicitly says so on
   pthread_self(3):
   "The  thread ID returned by pthread_self() is not the same thing as the
       kernel thread ID returned by a call to gettid(2)."

   Since glibc does not have a gettid, here we are using
   syscall(SYS_gettid)

This patch was tested with the program below. Compile and run:
   $ gcc p_hello2.c -o p_hello2 -lpthread
   $ ./p_hello2 10

You'll see that the main thread remains with its priority and threads
created by the main thread change their own niceness.

#include <errno.h>
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>

/* Lower priority of current thread.
 *
 * It's used by worker threads so they use up "bg cpu" as it was really intended
 * to work. If current thread is running with real-time priority, we decrease
 * our priority by 5. This is done in a portable way.  Otherwise we are
 * running with SCHED_OTHER policy and there's no portable way to set the nice
 * level on current thread. In Linux, it does work and it's the only one that is
 * implemented.
 */
static void
_ecore_thread_pri_drop(void)
{
   struct sched_param param;
   int pol, prio, ret;
   pid_t tid;
   pthread_t pthread_id;

   pthread_id = pthread_self();
   ret = pthread_getschedparam(pthread_id, &pol, &param);
   if (ret)
     {
        fprintf(stderr, "Unable to query sched parameters\n");
        return;
     }

   if (pol == SCHED_RR || pol == SCHED_FIFO)
     {
        prio = sched_get_priority_max(pol);
        param.sched_priority += 5;
        if (prio > 0 && param.sched_priority > prio)
           param.sched_priority = prio;

        pthread_setschedparam(pthread_id, pol, &param);
     }
#ifdef __linux__
   else
     {
        tid = syscall(SYS_gettid);
        errno = 0;
        prio = getpriority(PRIO_PROCESS, tid);
        if (errno == 0)
          {
             prio += 5;
             if (prio > 19)
                prio = 19;

             setpriority(PRIO_PROCESS, tid, prio);
          }
     }
 #endif
}

/*
 * p_hello.c -- a hello program (in pthread)
 */
#define MAX_THREAD 1000

typedef struct {
    int id;
} parm;

void *hello(void *arg)
{
    parm *p=(parm *)arg;
    pid_t tid;
    int prio;
    tid =  syscall(SYS_gettid);
    printf("[%d] Hello from node %d\n", tid, p->id);
    pthread_yield();

    printf("[%d] tid=%lu\n", tid);

    _ecore_thread_pri_drop();

    prio = getpriority(PRIO_PROCESS, tid);
    printf("[%d] New nice value: %d\n", tid, prio);
    return (NULL);
}

void main(int argc, char* argv[]) {
    int n,i;
    pthread_t *threads;
    pthread_attr_t pthread_custom_attr;
    parm *p;

    pid_t tid;
    int prio;

    if (argc != 2)
    {
        printf ("Usage: %s n\n  where n is no. of threads\n",argv[0]);
        exit(1);
    }

    n=atoi(argv[1]);

    if ((n < 1) || (n > MAX_THREAD)) {
        printf ("The no of thread should between 1 and %d.\n",MAX_THREAD);
        exit(1);
    }

    threads = (pthread_t *)malloc(n * sizeof(*threads));
    pthread_attr_init(&pthread_custom_attr);

    p = (parm *)malloc(n * sizeof(parm));
    /* Start up thread */

    tid = syscall(SYS_gettid);
    for (i=0; i<n; i++) {
        prio = getpriority(PRIO_PROCESS, tid);
        printf("[%d] root thread nice value: %d\n", tid, prio);

        p[i].id=i;
        pthread_create(&threads[i], &pthread_custom_attr, hello, (void *)(p+i));
    }

    /* Synchronize the completion of each thread. */

    for (i=0; i<n; i++) {
        pthread_join(threads[i],NULL);
    }
    free(p);
}



SVN revision: 52039
2010-09-09 11:48:31 +00:00
Lucas De Marchi be1b6d32ef Fix common misspellings
Following misspellings were fixed:

alledgedly->allegedly
cant->can't
carefull->careful
consistant->consistent
currenly->currently
dependancy->dependency
descripters->descriptors
doesnt->doesn't
dosen't->doesn't
existant->existent
exmaple->example
inbetween->between
independant->independent
isnt->isn't
mroe->more
neccessary->necessary
occured->occurred
occurence->occurrence
parrallel->parallel
particualr->particular
preceeding->preceding
recieved->received
recieves->receives
seperate->separate
substraction->subtraction
succesfully->successfully
successfull->successful
sucess->success
supress->suppress
usefull->useful
witht->with



SVN revision: 51986
2010-09-08 11:23:42 +00:00
Brett Nash 4bf9ee3df3 Merge branch 'elmdnd'
Conflicts:
	trunk/TMP/st/elementary/.gitignore

SVN revision: 51935
2010-09-07 06:56:16 +00:00
Cedric BAIL d098e05951 * ecore: fix error detection of ecore_pipe_add.
SVN revision: 51926
2010-09-06 16:36:44 +00:00
Christopher Michael e2b4501a74 Prototypes for the missing ecore_x convert functions.
SVN revision: 51906
2010-09-05 15:40:36 +00:00
Carsten Haitzler 9049befccf make 1 func to set lower pri - fall back to setpriority on linux and
try it there only.



SVN revision: 51885
2010-09-04 14:32:50 +00:00
Carsten Haitzler 05cf40fc4d same - back to RR.
SVN revision: 51878
2010-09-04 05:40:38 +00:00
Carsten Haitzler 2c397940de rr->other
SVN revision: 51873
2010-09-04 00:54:53 +00:00
Cedric BAIL b3dd293384 * ecore: ecore_thread are not here to bring your computer down, so
reduce their priority too.


SVN revision: 51862
2010-09-03 13:39:53 +00:00
Vincent Torri 156952f938 fix include order for Windows
SVN revision: 51740
2010-08-30 05:49:18 +00:00
Carsten Haitzler 46a62d5460 leak--
SVN revision: 51702
2010-08-28 15:07:45 +00:00
Carsten Haitzler 6402642686 more leak--
SVN revision: 51701
2010-08-28 14:56:14 +00:00